#!/usr/bin/env node
const log = console.log;
let timer1,timer2 = 1;
let count = 1;
log('start timer1...');
timer1 = setInterval(bomb1,500);
function bomb1() {
  log('I will loop forever!');

}
function bomb2(){
  log(' I will loop forever!');
  if(count++ >= 5){
    count = 0;
    log('Game over');
    global.clearInterval(timer2);
  }

}
setTimeout(()=>{
  log('Game over');
  clearInterval(timer1);
  log('start timer2...');
  timer2 =setInterval(bomb2,500);
},5000);
